<?=$this->render('header.phtml')?>

<div>
<div id="<?= $this->id ?>">
<?if ($this->pagerVisibility): ?>
<table cellspacing="0">
	<tr>
	<?if ($this->pagerVisibility): ?>
		<td class="pager">
		<?= $this->languages->_('Page') ?>
		
		<? $_curPage  = $this->paginator->getCurrentPageNumber() ?>
		<? $_lastPage = $this->paginator->count() ?>
		
		<? if($_curPage>1): ?>
			<a href="#" title="<?= $this->languages->_('Previous page') ?>" onclick="<?= $this->id ?>JsObject.setPage('<?= $_curPage-1 ?>');return false;"><img src="<?=$this->baseUrl?>/css/images/pager_arrow_left.gif" class="arrow"/></a>
		<? else: ?>
			<img src="<?=$this->baseUrl?>/css/images/pager_arrow_left_off.gif" alt="<?= $this->languages->_('Previous page') ?>" class="arrow"/>
		<? endif; ?>
		
		<input type="text" name="page" value="<?= $_curPage ?>" class="input-text page" onkeypress="<?= $this->id ?>JsObject.inputPage(event, '<?= $_lastPage ?>')"/>
		
		<? if($_curPage < $_lastPage): ?>
			<a href="#" title="<?= $this->languages->_('Next page') ?>" onclick="<?= $this->id ?>JsObject.setPage('<?= $_curPage+1 ?>');return false;"><img src="<?=$this->baseUrl?>/css/images/pager_arrow_right.gif" class="arrow"/></a>
		<? else: ?>
			<img src="<?=$this->baseUrl?>/css/images/pager_arrow_right_off.gif" alt="<?= $this->languages->_('Next page') ?>" class="arrow"/>
		<? endif; ?>
		<? printf($this->languages->_("of %s pages"), $_lastPage) ?>
		<span class="separator">|</span>
		
		<?php echo $this->languages->_('View') ?>
		<select name="limit" onchange="<?= $this->id ?>JsObject.loadByElement(this)">
			<option value="20"<? if($this->paginator->getItemCountPerPage()==20): ?> selected="selected"<? endif; ?>>20</option>
			<option value="30"<? if($this->paginator->getItemCountPerPage()==30): ?> selected="selected"<? endif; ?>>30</option>
			<option value="50"<? if($this->paginator->getItemCountPerPage()==50): ?> selected="selected"<? endif; ?>>50</option>
			<option value="100"<? if($this->paginator->getItemCountPerPage()==100): ?> selected="selected"<? endif; ?>>100</option>
			<option value="200"<? if($this->paginator->getItemCountPerPage()==200): ?> selected="selected"<? endif; ?>>200</option>
		</select>
            
		<?= $this->languages->_('per page') ?><span class="separator">|</span>
		<? printf($this->languages->_('Total %d records found'), $this->paginator->getAdapter()->count()) ?>
		</td>
	<?endif; ?>
	
	<? if($this->exportTypes): ?>
		<td>
			<img src="<?= $this->baseUrl?>/css/images/icon_export.gif" alt="" />&nbsp; <?= $this->languages->_('Export to:') ?>
			<select name="<?= $this->id ?>_export" id="<?= $this->id ?>_export" style="width:8em;">
				<? foreach ($this->exportTypes as $_type): ?>
				<option value="<?= $_type->url ?>"><?= $_type->label ?></option>
				<? endforeach; ?>
			</select>
			<button onclick="<?=$this->id ?>JsObject.doExport()" type="button">
				<span><?= $this->languages->_('Export') ?></span>
			</button>
		</td>
	<? endif; ?>
    
    <?= $this->partial('grid/massaction.phtml', array(
    'id' => $this->id,
    'languages' => $this->languages,
    'actionItems' => $this->actionItems)); ?>
	</tr>
</table>
<? endif; ?>
</div>
</div>